package structural.facade;

import structural.facade.custom.HomeTheaterFacade;
import structural.facade.custom.devices.*;

/**
 * 外观模式
 * 为多个复杂的子系统提供一个一致的接口，使这些子系统更加容易被访问。
 * 外观模式只将多个组件在特定场景下建立了有机的组合，并未限制对组件的直接调用
 */
public class Main {

    public static void main(String[] args) {
        CdPlayer cdPlayer = new CdPlayer();
        Curtain curtain = new Curtain();
        Fan fan = new Fan();
        Light light = new Light();
        Tv tv = new Tv();
        Thermometer thermometer = new Thermometer();
        Clock clock = new Clock();
        HomeTheaterFacade homeTheaterFacade = new HomeTheaterFacade(cdPlayer, curtain, fan, light, tv, thermometer, clock);

        homeTheaterFacade.watchMovie();
        homeTheaterFacade.close();

        homeTheaterFacade.comfortable();
    }
}
